package org.example.hansp.array_.array_exercise;

public class ArrayColumnSum {
    public static void main(String[] args) {
        double array[][]={{1.5,2,3,4},{5.5,6,7,8},{9.5,1,3,1}};
        for (int i = 0; i < 4; i++) {
            System.out.println(sunColumn(array, i));
        }

    }
    public static double sunColumn(double[][] m,int columnIndex){
        double sum = 0;
        for(int i = 0; i < m.length; i++){
            sum += m[i][columnIndex];
        }
        return sum;
    }
}
